#include "app.h"

#include <QApplication>
#include <QLocale>
#include <QTranslator>

#include "shape.h"

int main(int argc, char* argv[])
{
	qRegisterMetaType<Shape>("Shape");

	QApplication a(argc, argv);

	QTranslator translator;
	const QStringList uiLanguages = QLocale::system().uiLanguages();
	for (const QString& locale : uiLanguages)
	{
		const QString baseName = "labelmex_" + QLocale(locale).name();
		if (translator.load(":/i18n/" + baseName))
		{
			a.installTranslator(&translator);
			break;
		}
	}
	app w;
	w.show();
	return a.exec();
}
